import tkinter as tk
from tkinter import messagebox

class application(tk.Frame):
    def __init__(self,master=None):
        self.master=master
        super().__init__(master)
        self.creatWedgit()

    def creatWedgit(self):
        self.f1=tk.Frame(self.master,bg='pink')
        self.f1.place(x=0,y=0,relwidth=1,relheight=0.1)
        self.v1=tk.StringVar()
        self.e1=tk.Entry(self.f1,textvariable=self.v1,justify='right',font=("arial",18))
        self.e1.place(relx=0,rely=0,relwidth=1,relheight=1)

        self.f2=tk.Frame(self.master,bg='pink')
        self.f2.place()

window=tk.Tk()
window.title('计算器')
app=application(window)
window.mainloop()